package com.example.hms.controller;

import com.example.hms.entity.Room;
import com.example.hms.entity.RoomType;
import com.example.hms.service.RoomService;
import com.example.hms.service.RoomTypeService;
import com.example.hms.util.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;

@RestController
@RequestMapping("room")
public class RoomController {
    //    动态注入下一层RoomService（服务层）
    @Resource
    private RoomService roomService;
    @RequestMapping(value = "/selectAllRoom",method = RequestMethod.GET)
    public Result selectAllRoom(String roomNumber, String roomTypeName, String roomId) {
        return roomService.selectAllRoom(roomNumber,roomTypeName,roomId);
    }
    @RequestMapping(value = "/insert",method = RequestMethod.GET)
    public Result insert(Room room, HttpServletRequest request)
        { return roomService.insert(room,request);}

    @RequestMapping(value = "/update",method = RequestMethod.GET)
    public Result update(Room room, HttpServletRequest request)
        {return roomService.update(room,request);}

    @RequestMapping(value = "/delete",method = RequestMethod.GET)
    public Result delete(Room room, HttpServletRequest request)
        { return roomService.delete(room,request);}
}
